package com.yvon.service.demo.design;

/**
 * @author : Yvon
 * @since : 2021-12-16
 */
public class SingleDemo {

    public static volatile SingleDemo instance;
    private SingleDemo(){}

    public static SingleDemo getInstance() {
        if (instance == null) {
            synchronized (SingleDemo.class) {
                if (instance == null) {
                    instance = new SingleDemo();
                }
            }
        }
        return instance;
    }
}
